import React, { Component } from 'react';
import Animated from "animated/lib/targets/react-dom";

class Ani extends Component {
  constructor (...args) {
    super(...args);
    this.state = {
      anim: new Animated.Value(0)
    };
  }

  fnClick () {
    Animated.timing(this.state.anim, {
      toValue: 100,
      duration: 500
    }).start();
  }

  render() {
    return (
      <div>
        {/* <div className="box"></div> */}
        <Animated.div
          className="box"
          style={{left: this.state.anim}}
          onClick={this.fnClick.bind(this)}
        />
      </div>
    );
  }

}

export default Ani;
